cmake_minimum_required(VERSION 2.8)
PROJECT( ruanko )
set(CMAKE_CXX_COMPILER "clang++") 
SET( DIR_OUTPUT output )
SET( CMAKE_BUILD_TYPE "debug")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR_OUTPUT})
SET( SERVER_NAME ${DIR_OUTPUT}/server )
SET( CLIENT_NAME ${DIR_OUTPUT}/client )
INCLUDE_DIRECTORIES( include )

FIND_LIBRARY( LOG4CPP log4cpp)
FIND_LIBRARY( BOOSTSYSTEM boost_system-mt )
FIND_LIBRARY( BOOSTTHREAD boost_thread-mt )
FIND_LIBRARY( BOOSTDATETIME boost_date_time-mt )
FIND_LIBRARY( BOOSTCHRONO boost_chrono-mt )
FIND_LIBRARY( SQLITE3	sqlite3 )
FIND_LIBRARY( CONFIG config++ )
FIND_LIBRARY( PROTOBUF protobuf )

AUX_SOURCE_DIRECTORY( test_src SERVER_SRCS )
AUX_SOURCE_DIRECTORY( client_src CLIENT_SRCS )
ADD_EXECUTABLE( ${SERVER_NAME} ${SERVER_SRCS} )
ADD_EXECUTABLE( ${CLIENT_NAME} ${CLIENT_SRCS} )

TARGET_LINK_LIBRARIES( ${SERVER_NAME}  ${LOG4CPP} ${BOOSTDATETIME} ${BOOSTSYSTEM} ${BOOSTTHREAD} ${SQLITE3} ${CONFIG} ${PROTOBUF} 
						${BOOSTCHRONO} )
TARGET_LINK_LIBRARIES( ${CLIENT_NAME}  ${LOG4CPP} ${BOOSTDATETIME} ${BOOSTSYSTEM} ${BOOSTTHREAD} ${SQLITE3} ${CONFIG} ${PROTOBUF} 
						${BOOSTCHRONO} )
